<!-- /* Description for file.
 * 资源定制-修改
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/resources
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张海杰2011年0624
 * @lastmodified  张海杰2011年0624
 */
 -->
<?php
echo $html->css ( 'tab' );
echo $html->css ( 'style' );
echo $javascript->link('jquery-1.4.2');
echo $html->css('start/jquery-ui-1.8.2.custom');
echo $javascript->link('jquery-ui-1.8.2.custom.min');
echo $html->css ( 'jquery-validate/css/screen' );
echo $javascript->link ( 'jquery-validate/jquery.validate');
echo $javascript->link ( 'jquery-validate/additional-methods');
echo $javascript->link ( 'jquery-validate/localization/messages_cn');

?>

<script type="text/javascript">
//添加验证
$(document).ready(function() {
	$.validator.setDefaults({       
		 submitHandler: function(form) {    
		  form.submit();    
		}       
	});   
			
	$("#ResourceEditForm").validate({
		rules: {
		"data[Resource][resourceName]" :{
			required: true,alowsome:true,stringMinLength:0,stringMaxLength:50
			},//主题
			"data[Resource][description]"  :{
				required: false,stringMinLength:0,stringMaxLength:255
				}
		},
		messages:{},
		focusInvalid:false,
		onkeyup:false,
		errorPlacement:function(error, element){error.appendTo(element.parent());}
	});
});
//验证结束
</script>




<script type="text/javascript">
$(document).ready(function(){
	$("#ResourceOrgans").change(function()
	{									
		var changeorgansid = $(this).find('option:selected').val();
		$("#ResourceOrganId").val(changeorgansid);
	});
});

</script>
<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Resourcebooksmanage');//一级目录
										   echo '>';echo __('Resources');//二级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('Edit Resources',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->
<div class="tabflex">
<?php echo $form->create('Resource',array('action'=>'edit'));?>
	<fieldset>
 		<legend><?php __('Edit Resources');?></legend>
 		<table width="100%" cellspacing="0" cellpadding="0" border="0"
style="text-align: left">
	<tr>
	<td>
	<?php
		echo $form->input('id',array('default'=>$data['Resource']['id'])); 
		echo $form->hidden('creater');
		echo $form->hidden('created ');
		echo $form->hidden('modified ');
		echo $form->hidden('updater');?> </td>
	</tr>
	
	<tr>
		<td width="50"></td>
		<td width="100"><?php __('ResourcesName');?>:<font color="red">*</font></td>
		<td colspan="4">
		<?php echo $form->input('resourceName',array('class' => 'TextBoxH','label'=>false,'default'=>$data['Resource']['resourceName']));?>
		</td>
	</tr>
	<tr>
		<td width="50"></td>
		<td width="100"><?php __('Resources organs');?>:</td>
		<td >
		<?php $options = array();
					foreach($organs as $eachrecord)
					{	
									
						$options[$eachrecord['Organ']['id']] = $eachrecord['Organ']['name'];
					}
					//echo $form->input('organs',array('options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1','empty' =>'不限'));
					if($data['Resource']['organ_id']== NULL){
							echo $form->input('organs',array('options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1','empty' =>'不限'));
						}
					else{
						echo $form->input('organs',array('options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1','empty' =>'不限','default' =>$data['Resource']['organ_id']));	
									
					}
					
		?>
		</td>
		<td width="50"><?php  echo $form->hidden('organ_id',array('default'=>$data['Resource']['organ_id']));?></td>
		<td width="100"><?php __('Status');?>:</td>
		<td >
		<?php echo $form->input('status',
				array(
				'options'=>array('0'=>'可用','1'=>'不可用'),
				'label'=>false,'div'=>false,'default'=>$data['Resource']['status']));		
		?>
		
		</td>
	</tr>
	<tr>
		<td width="50"></td>
		<td width="100"><?php __('Resources Description');?>:</td>
		<td colspan="4">
		<?php echo $form->textarea('description',array('class' => 'TextBoxH','label'=>false,'default'=>$data['Resource']['description']));?>
		</td>
	</tr>
	</table>
	</fieldset>
	<?php echo $form->button('返回',array('type'=>'button','class'=>'btn2','onclick'=>'history.back(-1)'));?>  <!-- 返回上一级-->
	<?php echo $form->button('确定',array('type'=>'submit','class'=>'btn2'));?>  <!-- __('reset', true)取消-->
	<?php echo $form->button('重置',array('type'=>'reset','class'=>'btn2'));?>
	<?php echo $form->end();?><!-- 确定-->
</div>